<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

return [
    'enable' =>  env("NACOS_ENABLE",true),
    // 'url' => '',
    // The nacos host info
    'host' => env("NACOS_HOST",'127.0.0.1'),
    'port' => env("NACOS_PORT",8848),
    // The nacos account info
    'username' => null,
    'password' => null,
    'config_merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE,
    // The service info.
    'service' => [
        'enable'=> env("NACOS_ENABLE",true),
        'service_name' =>  env("APP_NAME",'lsk-msystem'),
        'group_name' => 'DEFAULT_GROUP',
        'namespace_id' => env("NACOS_NAMESPACE_ID",''),
        'protect_threshold' => 0.5,
        'instance'=>[
            'ephemeral'=>true,
            'heartbeat'=>5,
            'weight'=>80
        ],
        'matadata'=>'preserved.register.source=lsk'
    ],
    // The client info.
    'client' => [
        'service_name' => env("APP_NAME",'lsk-msystem'),
        // 'group_name' => '',
        'weight' => 80,
        'cluster' => 'DEFAULT',
        'ephemeral' => true,
        'beat_enable' => true,
        'beat_interval' => 5,
        'namespace_id'=>env("NACOS_NAMESPACE_ID",'')
        //'namespace_id' => 'namespace_id', // It must be equal with service.namespaceId.
    ],
    'remove_node_when_server_shutdown' => true,
    'config_reload_interval' => 3,
    'config_append_node' => 'nacos_config',
    'listener_config' => [
        // dataId, group, tenant, type, content
        //[
        //    'tenant' => 'tenant', // corresponding with service.namespaceId
        //    'data_id' => 'hyperf-service-config',
        //    'group' => 'DEFAULT_GROUP',
        //],
        //[
        //    'data_id' => 'hyperf-service-config-yml',
        //    'group' => 'DEFAULT_GROUP',
        //    'type' => 'yml',
        //],
    ],
    'load_balancer' => 'random',
];
